All Functions of Week 8

slice

{dplyr}

Subset rows using their positions

select

{dplyr}

Select columns from a tibble/data frame

sum

{base}

Get sum of numeric values or a vector

quantile

{stats}

Obtain empirical quantiles of a vector

plot

{graphics}

Generic function from base R to produce a plot

ifelse

{base}

Return a or b depending on the value of test

c

{base}

Combine values/vectors into a vector

spread

{tidyr}

Spread a key-value pair across multiple columns

mutate

{dplyr}

Modify/create a column in a data frame

filter

{dplyr}

Filter out rows of a data frame according to logical vector

as.numeric

{base}

Coerce a vector to numeric

par

{graphics}

Set parameters of the plotting device

library

{base}

Load an R package

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

recode

{dplyr}

Recode a variable

as.character

{base}

Coerce a vector to character

is.na

{base}

Check if a value is NA/elements of vector are NA

n

{dplyr}

The number of observations in the current group.

mean

{base}

Get mean of a vector

separate

{dplyr}

Separate a character column into multiple columns

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

seq

{base}

Create a sequence

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

factor

{base}

Create a factor

cut

{base}

Convert Numeric to Factor

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

setwd

{base}

Set Working Directory

read_dta

{haven}

Read a .dta file (Stata data)

expression

{base}

Used in plots to add symbols to axes

desc

{dplyr}

Arrange in descending order

rm

{base}

Remove objects

save

{base}

Writes an external representation of R objects to the specified file.

write.csv

{utils}

write a csv file to a data frame

ordered

{dplyr}

Create an ordered factor

colnames

{base}

Retrieve column names of a data frame

dnorm

{stats}

Density distribution for the normal distribution

data.frame

{base}

Create a data.frame from vectors

The end!